package com.itheima.observer.demo;

/**
 * @author zzw
 * @date 2025/10/25
 * @description 客户端测试类
 */
public class Client {
    public static void main(String[] args) {
        // 创建小偷对象
        Thief thief = new Thief("张三");

        // 创建警察对象
        Policemen policeman1 = new Policemen("李警官");
        Policemen policeman2 = new Policemen("王警官");

        // 注册观察者
        thief.addObserver(policeman1);
        thief.addObserver(policeman2);

        // 小偷开始偷东西
        thief.steal();
    }
}
